package com.feng.cloud.system.controller;

import com.feng.cloud.common.response.RestResponse;
import com.feng.cloud.system.entity.Menu;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Map;

/**
 * @ClassName IMenuController
 * @Description TODO
 * @Author Better Feng
 * @Date 2019/12/21 22:10
 * @Version 1.0
 **/
public interface IMenuController {

    /**
     * 根据id删除菜单
     * @param menuIds menuIds
     * @return RestResponse<Void>
     */
    @DeleteMapping("{menuIds}")
    RestResponse<Void> deleteMenuByIds(@NotBlank(message = "{required}")@PathVariable String menuIds);
    /**
     * 更新菜单
     * @param menu menu
     * @return RestResponse<Menu>
     */
    @PutMapping
    RestResponse<Menu> updateMenu(@Valid Menu menu);
    /**
     * 增加菜单
     * @param menu menu
     * @return RestResponse<Menu>
     */
    @PostMapping
    RestResponse<Menu> addMenu(@Valid Menu menu);

    @GetMapping("/{username}")
    RestResponse<Map<String, Object>> getUserRouters(@NotBlank(message = "{required}") @PathVariable String username);
}
